package com.dsd.datav.constants;

import com.dsd.datav.enums.DataDict;
import com.dsd.datav.enums.DatavsmapType;
import com.dsd.datav.enums.ResultCode;
import lombok.Data;

import java.io.Serializable;

/**
 * @author Administrator
 * @Title: dataTurn
 * @ProjectName datav
 * @Description: TODO
 * @date 2024/1/18 00182024/1/18 0018
 */
public class DataTurn implements Serializable {
    private String value;
    private String label;
    private String color;
    private String type;
    private String desc;
    private String type1;
    private String desc1;
    public String getType1() {
        return type1;
    }

    public void setType1(String type1) {
        this.type1 = type1;
    }

    public String getDesc1() {
        return desc1;
    }

    public void setDesc1(String desc1) {
        this.desc1 = desc1;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String name) {
        this.desc = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public DataTurn() {
    }

    public DataTurn(String value,String label,String color,String type,String desc,String type1,String desc1) {
        this.value = value;
        this.label = label;
        this.color = color;
        this.type = type;
        this.desc = desc;
        this.type1 = type1;
        this.desc1 = desc1;
    }
    /**
     * 转换类型
     * @param type
     */
    public void  setDatavsmapType(String type,String type1,String type2) {
        switch (type){
            case "0":
                this.value = (DatavsmapType.INDIVIDUALBUSINESS.value());
                this.label = (DatavsmapType.INDIVIDUALBUSINESS.label());
                break;
            case "1":
                this.value = (DatavsmapType.PROFESSIONALCOOPERATIVE.value());
                this.label = (DatavsmapType.PROFESSIONALCOOPERATIVE.label());
                break;
            case "2":
                this.label = (DatavsmapType.VILLAGECADRES.label());
                this.value = (DatavsmapType.VILLAGECADRES.value());
                break;
            case "3":
                this.label = (DatavsmapType.FAMILYFARM.label());
                this.value = (DatavsmapType.FAMILYFARM.value());
                break;
            case "4":
                this.value = (DatavsmapType.SMALLANDMICROENTERPRISES.value());
                this.label = (DatavsmapType.SMALLANDMICROENTERPRISES.label());
            break;
        }
        switch (type1){
            case "0":
                this.type = (DataDict.NO.type());
                this.desc = (DataDict.NO.desc());
                break;
            case "1" :
                this.type = (DataDict.IS.type());
                this.desc = (DataDict.IS.desc());
                break;
        }
        switch (type2){
            case "0":
                this.type1 = (DataDict.NO.type());
                this.desc1 = (DataDict.NO.desc());
                break;
            case "1" :
                this.type1 = (DataDict.IS.type());
                this.desc1 = (DataDict.IS.desc());
                break;
        }
    }
    public static DataTurn enumsToData(String type,String type1,String type2){
        DataTurn dataTurn = new DataTurn();
        dataTurn.setDatavsmapType(type,type1,type2);
        return dataTurn;
    }
    /**
     *
     */
    public void setIndicatorColor(String color){

    }
}
